import { request } from '@/utils/http'
/**
 * 数据字段管理
 */
export const type = {
    create: data => request.get('/dict/types', data),
    delete: id => request.delete(`/dict/type/${id}`),
    update: data => request.put(`/dict/type/${data.id}`, data),
    list: (params = {}) => request.get('/dict/type', { params }),
    getById: id => request.get(`/dict/type/${id}`),
}
export const data = {
    create: data => request.post('/dict/data', data),
    delete: id => request.delete(`/dict/data/${id}`),
    update: data => request.put(`/dict/data/${data.id}`, data),
    list: (params = {}) => request.get('/dict/data', { params }),
    getById: id => request.get(`/dict/data/${id}`),
}
export default {
    /**
     * 获取省份
     */
    getProvince: () => request.get(`/dict/province`),
    /**
     * 查询年级
     */
    getGrade: (params) => request.get('/dict/grade', { params }),
    /**
     * 查询指定阶段的题型
     */
    getQuestionTypes: (params) => request.get('/dict/question-types', { params }),
    /**
     * 查询指定阶段的题型
     */
    getQuestionCategory: () => request.get('/dict/question-category'),
    /**
     * 返回高中、初中、小学所有科目
     */
    getAllSubject: () => request.get('/dict/allSubject'),
}
